﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Createresume.aspx.cs" Inherits="Student_Createresume" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server" action = "http://www.cc.ntut.edu.tw/~t8820326/testDB/resume.php">
    <div>
        <span style="font-weight:bold; font-size: x-large;">履歷表</span>
        <br /><br />
        <span style="font-weight:bold;color: blue;font-size: large;">一、基本資料</span>
        <br />
        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
            DataKeyNames="StudentId" DataSourceID="SqlDataSource1" Height="50px" 
            Width="276px">
            <Fields>
                <asp:TemplateField HeaderText="StudentId" SortExpression="StudentId">
                    <EditItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("StudentId") %>'></asp:Label>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("StudentId") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label15" runat="server" Text='<%# Eval("StudentId") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField5" runat="server" 
                            Value='<%# Eval("StudentId") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="StudentName" SortExpression="StudentName">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("StudentName") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("StudentName") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label14" runat="server" Text='<%# Eval("StudentName") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField4" runat="server" 
                            Value='<%# Eval("StudentName") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Birth" SortExpression="Birth">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Birth") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Birth") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("Birth", "{0:d}") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField6" runat="server" 
                            Value='<%# Eval("Birth", "{0:d}") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Email" SortExpression="Email">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Email") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Email") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("Email") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField7" runat="server" 
                            Value='<%# Eval("Email") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Gender" SortExpression="Gender">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Gender") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("Gender") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("Gender") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField8" runat="server" 
                            Value='<%# Eval("Gender") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="SelfIntro" SortExpression="SelfIntro">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("SelfIntro") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("SelfIntro") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("SelfIntro") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField9" runat="server" 
                            Value='<%# Eval("SelfIntro") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Address" SortExpression="Address">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("Address") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("Address") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label7" runat="server" Text='<%# Bind("Address") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField10" runat="server" 
                            Value='<%# Eval("Address") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="SSN" SortExpression="SSN">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("SSN") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("SSN") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label8" runat="server" Text='<%# Bind("SSN") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField11" runat="server" Value='<%# Eval("SSN") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="CellPhone" SortExpression="CellPhone">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("CellPhone") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("CellPhone") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label10" runat="server" Text='<%# Bind("CellPhone") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField13" runat="server" 
                            Value='<%# Eval("CellPhone") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Phone" SortExpression="Phone">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("Phone") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox11" runat="server" Text='<%# Bind("Phone") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label11" runat="server" Text='<%# Bind("Phone") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField14" runat="server" 
                            Value='<%# Eval("Phone") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="DepartmentName" SortExpression="DepartmentName">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox11" runat="server" Text='<%# Bind("DepartmentName") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox12" runat="server" Text='<%# Bind("DepartmentName") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label12" runat="server" Text='<%# Bind("DepartmentName") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField15" runat="server" 
                            Value='<%# Eval("DepartmentName") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
            </Fields>
        </asp:DetailsView>
        
        
        <br />
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ProjectConnectionString %>" 
            SelectCommand="SELECT Student.StudentId, Student.StudentName, Student.Birth, Student.Email, Student.Gender, Student.SelfIntro, Student.Address, Student.SSN, Student.DepartmentId, StudentCellPhone.CellPhone, StudentPhone.Phone, Department.DepartmentName FROM Student INNER JOIN StudentCellPhone ON Student.StudentId = StudentCellPhone.StudentId INNER JOIN StudentPhone ON Student.StudentId = StudentPhone.StudentId INNER JOIN Department ON Student.DepartmentId = Department.DepartmentId WHERE (Student.StudentId = @StudentId)">
            <SelectParameters>
                <asp:SessionParameter Name="StudentId" SessionField="userName" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
   
        <span style="font-weight:bold;color: blue;font-size: large;">二、技能列表</span>
        <br />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="serial" DataSourceID="SqlDataSource2" 
            ondatabound="GridView1_DataBound">
            <Columns>
                <asp:TemplateField HeaderText="SkillId" SortExpression="SkillId">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("SkillId") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label13" runat="server" Text='<%# Eval("SkillId") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField1" runat="server" 
                            Value='<%# Eval("SkillId") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="SkillName" SortExpression="SkillName">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("SkillName") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("SkillName") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField2" runat="server" 
                            Value='<%# Eval("SkillName") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Intro" SortExpression="Intro">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Intro") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("Intro") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField3" runat="server" 
                            Value='<%# Eval("Intro") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <br />
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ProjectConnectionString %>" 
            SelectCommand="SELECT Has_Ski.StudentId, Has_Ski.SkillId, Has_Ski.serial, Skills.SkillName, Skills.Intro FROM Has_Ski INNER JOIN Skills ON Has_Ski.SkillId = Skills.SkillId WHERE (Has_Ski.StudentId = @StudentId)">
            <SelectParameters>
                <asp:SessionParameter Name="StudentId" SessionField="userName" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <span style="font-weight:bold;color: blue;font-size: large;">三、證照</span><br />
        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="serial" DataSourceID="SqlDataSource3" 
            ondatabound="GridView2_DataBound">
            <Columns>
                <asp:TemplateField HeaderText="CertificateName" 
                    SortExpression="CertificateName">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("CertificateName") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("CertificateName") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField16" runat="server" 
                            Value='<%# Eval("CertificateName") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Time" SortExpression="Time">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Time") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Time", "{0:d}") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField17" runat="server" 
                            Value='<%# Eval("Time", "{0:d}") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Intro" SortExpression="Intro">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Intro") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("Intro") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField18" runat="server" 
                            Value='<%# Eval("Intro") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ProjectConnectionString %>" 
            SelectCommand="SELECT * FROM [Certificate] WHERE ([StudentId] = @StudentId)">
            <SelectParameters>
                <asp:SessionParameter Name="StudentId" SessionField="userName" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
        <span style="font-weight:bold;color: blue;font-size: large;">四、修課紀錄</span><br />
        <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="serial" DataSourceID="SqlDataSource4" 
            ondatabound="GridView3_DataBound">
            <Columns>
                <asp:TemplateField HeaderText="CourseId" SortExpression="CourseId">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("CourseId") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("CourseId") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField19" runat="server" 
                            Value='<%# Eval("CourseId") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="CourseName" SortExpression="CourseName">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("CourseName") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("CourseName") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField20" runat="server" 
                            Value='<%# Eval("CourseName") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Grade" SortExpression="Grade">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Grade") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Grade") %>'></asp:Label>
                        <asp:HiddenField ID="HiddenField21" runat="server" 
                            Value='<%# Eval("Grade") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ProjectConnectionString %>" 
            SelectCommand="SELECT CourseTaken.StudentId, CourseTaken.CourseId, CourseTaken.Grade, CourseTaken.serial, Course.CourseName FROM CourseTaken INNER JOIN Course ON CourseTaken.CourseId = Course.CourseId WHERE (CourseTaken.StudentId = @StudentId)">
            <SelectParameters>
                <asp:SessionParameter Name="StudentId" SessionField="userName" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:HiddenField ID="HiddenField22" runat="server" />
        <asp:HiddenField ID="HiddenField23" runat="server" />
        <asp:HiddenField ID="HiddenField24" runat="server" />
        <br />
        <input type="submit" value="產生履歷表"><br />
   
    </div>
    </form>
</body>
</html>
